home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / info / ti813.zip / TI813.TXT
Text File  |  1992-08-12  |  3KB  |  33 lines

  1.  
  2. PRODUCT  :  Turbo C++, Borland C++                 NUMBER  :  813             
  3. VERSION  :  All                                                               
  4. OS  :  DOS                                                                    
  5. DATE  :  February 25, 1992                        PAGE  :  1/1                
  6.                                                                               
  7. TITLE  :  Dealing with Stack Overflow Problems                                
  8.                                                                               
  9.                                                                               
  10.                                                                               
  11.                                                                               
  12. Symptoms of stack overflow are numerous.  They include program                
  13. crashing, returning to wrong address, local/global variables                  
  14. getting corrupted, and so on.  The default size for the stack is              
  15. 4096 bytes, or 4K.  To increase the size of the stack, the                    
  16. _stklen variable is used.                                                     
  17.                                                                               
  18. Here's how to make the assignment:                                            
  19.                                                                               
  20. extern unsigned _stklen = xxxxx;                                              
  21.                                                                               
  22. where xxxx is a number between 256 - 65535 bytes.                             
  23.                                                                               
  24. The variable must be declared in the global memory location in                
  25. the program, and you must include dos.h.  You will get a                      
  26. duplicate symbol declaration warning from the linker, which you               
  27. may ignore.                                                                   
  28.                                                                               
  29. Note:  The linker map will still report the stack as being 4K,                
  30. even though you changed it's size.  The helpme!.doc also                      
  31. describes how to increase the stack length.                                   
  32.                                                                               
  33.